Skip to content

refactor(express): split login endpoint into V1 and V2#8586

Open
rishikeshdadam136 wants to merge 1 commit intomasterfrom
WCI-186
Open

refactor(express): split login endpoint into V1 and V2#8586
rishikeshdadam136 wants to merge 1 commit intomasterfrom
WCI-186

Conversation

@rishikeshdadam136
Copy link
Copy Markdown
Contributor

Ticket: WCI-186

Context - https://bitgo.slack.com/archives/C057BHBRG4B/p1764020095794829?thread_ts=1764018507.602879&cid=C057BHBRG4B

The API behavior is not changing. We are splitting the combined v[12] route into two separate V1 and V2 routes, so both will continue to work and clients will not be affected.

@linear
Copy link
Copy Markdown

linear Bot commented Apr 21, 2026

@rishikeshdadam136
Copy link
Copy Markdown
Contributor Author

Tested in local for both v1 and v2

@rishikeshdadam136 rishikeshdadam136 marked this pull request as ready for review April 21, 2026 13:13
@rishikeshdadam136 rishikeshdadam136 requested review from a team as code owners April 21, 2026 13:13
@rishikeshdadam136 rishikeshdadam136 marked this pull request as draft April 21, 2026 16:05
@rishikeshdadam136 rishikeshdadam136 requested a deployment to breaking-changes-override April 22, 2026 10:07 — with GitHub Actions Waiting
@rishikeshdadam136 rishikeshdadam136 marked this pull request as ready for review April 22, 2026 10:56
@rishikeshdadam136 rishikeshdadam136 requested a deployment to breaking-changes-override April 22, 2026 11:47 — with GitHub Actions Waiting
@rishikeshdadam136 rishikeshdadam136 force-pushed the WCI-186 branch 2 times, most recently from 6105329 to 49b1ad3 Compare April 22, 2026 17:54
@rishikeshdadam136 rishikeshdadam136 requested a deployment to breaking-changes-override April 22, 2026 18:03 — with GitHub Actions Waiting
@rishikeshdadam136 rishikeshdadam136 requested a deployment to breaking-changes-override April 23, 2026 06:28 — with GitHub Actions Waiting
@rishikeshdadam136 rishikeshdadam136 requested a deployment to breaking-changes-override April 23, 2026 08:36 — with GitHub Actions Waiting
Copy link
Copy Markdown
Contributor

@mrdanish26 mrdanish26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI failure, flushing the queue

body: LoginRequest,
}),
response: {
200: t.type({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: We can create common type for this

lokesh-bitgo
lokesh-bitgo previously approved these changes Apr 27, 2026
Copy link
Copy Markdown
Contributor

@lokesh-bitgo lokesh-bitgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall changes looks good

vmccarty
vmccarty previously approved these changes Apr 27, 2026
Copy link
Copy Markdown
Contributor

@vmccarty vmccarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rishikeshdadam136
Copy link
Copy Markdown
Contributor Author

Resolved merge conflicts and force pushed again.

@rishikeshdadam136 rishikeshdadam136 requested a deployment to breaking-changes-override April 27, 2026 16:08 — with GitHub Actions Waiting
mrdanish26
mrdanish26 previously approved these changes Apr 27, 2026
Copy link
Copy Markdown

@melizafranco melizafranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate or ambiguous entries in an OpenAPI spec create confusion in generated docs, client SDKs, and tools like Postman. Each operation should have a unique operationId, a distinct path, and a summary that makes clear what it is and how it differs from the similar one.

Comment on lines +7 to +16
* Login
*
* Authenticate a user and retrieve their session details.
*
* @operationId express.login
* @tag Express
* @public
*/
export const PostV2Login = httpRoute({
path: '/api/v2/user/login',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Login
*
* Authenticate a user and retrieve their session details.
*
* @operationId express.login
* @tag Express
* @public
*/
export const PostV2Login = httpRoute({
path: '/api/v2/user/login',
* Login (Express)
*
* Authenticate a user and retrieve their session details using BitGo Express.
*
* @operationId express.login
* @tag Express
* @public
*/
export const PostV2Login = httpRoute({
path: '/api/v2/user/login/express',

Make this endpoint path and summary unique from the REST login endpoint to avoid client confusion.

@kaustubhbitgo kaustubhbitgo removed their request for review April 28, 2026 05:07
@lokesh-bitgo
Copy link
Copy Markdown
Contributor

Duplicate or ambiguous entries in an OpenAPI spec create confusion in generated docs, client SDKs, and tools like Postman. Each operation should have a unique operationId, a distinct path, and a summary that makes clear what it is and how it differs from the similar one.

@melizafranco, I understand your point. However, the scope of this change is different. This is an existing login endpoint that previously combined both V1 and V2, which caused the API docs to fail to compile. You can find the details here: https://bitgo.slack.com/archives/C057BHBRG4B/p1764020095794829?thread_ts=1764018507.602879&cid=C057BHBRG4B.

Based on the feedback, we are splitting the endpoint into separate V1 and V2 endpoints with unique operationIds and paths, without changing the behavior. We will mark the V1 endpoint as private and the V2 endpoint as public, and only the V2 endpoint will be used by clients.

Regarding your feedback, the operationId is already unique and the paths are already distinct (V1 and V2). Since the behavior of both endpoints remains the same, the summary is also the same. As we are only splitting the endpoint without changing any existing behavior, I think the changes look fine. Please let me know if you have any concern here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants